package week_03.coef_additive;

import java.util.Arrays;
import java.util.Scanner;
import java.util.function.Function;

@SuppressWarnings("all")
public class coef_additive {
    public static void main(String[] args) {
        function Function = new function();
        int coeff_length[] = Function.coeff_length(2);
        int pow_length[] = Function.pow_length(2);
        int coeff_length2[] = Function.coeff_length(3);
        int pow_length2[] = Function.pow_length(3);
        System.out.println("请输入要计算的第一个函数的系数:");
        coeff_length = Function.arr(coeff_length);
        System.out.println(Arrays.toString(coeff_length));
        System.out.println("请输入要计算的第一个函数的指数:");
        pow_length = Function.arr(pow_length);
        System.out.println(Arrays.toString(pow_length));
        System.out.println("请输入要计算的第二个函数的系数:");
        coeff_length2 = Function.arr(coeff_length2);
        System.out.println("————————————————————————————————————————————————————————————————————————");
        System.out.println(Arrays.toString(coeff_length2));
        System.out.println("请输入要计算的第二个函数的指数:");
        pow_length2 = Function.arr(pow_length2);
        System.out.println(Arrays.toString(pow_length2));
        String s1 = Function.function(coeff_length, pow_length);
        String s2 = Function.function(coeff_length2, pow_length2);
        System.out.println("第一个多项式为:" + s1 + '\b' + '\b');
        System.out.println("————————————————————————————————————————————————————————————————————");
        System.out.println("第二个多项式为:" + s2 + '\b' + '\b');
        System.out.println("————————————————————————————————————————————————————————————————————");
        String str = Function.f_add(coeff_length, pow_length, coeff_length2, pow_length2);
        System.out.println("两个多项式相加得到的结果是" + str + '\b' + '\b');
    }
}
